package com.example.group4.controller;

import com.example.group4.pojo.Person;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@RestController
public class PersonController {

    @GetMapping("/Person")
    public Object GetPerson(){
        return new Person(1,"李四","男",28,"成都");
    }

    @GetMapping("/PersonList")
    public Object  GetPersonList(){
        List<Person> list = new ArrayList<>();

        list.add(new Person(1,"李一","男",28,"成都"));
        list.add(new Person(2,"李二","女",27,"亚洲"));
        list.add(new Person(3,"李三","女",26,"欧洲"));
        list.add(new Person(4,"李五","男",25,"美洲"));

        return  list;

    }

}
